package short_10;

public class shor_101010 {
    public static void main(String[] args) {
        short shor = 127;
        char chares[] = new char[16];
        int top = chares.length;
        while (true) {
            top--;
            if (top < 0) {
                break;
            }
            chares[top]=(char)((shor%2)+'0');//000000000 ←这样是因没+‘0’  数字转换char+‘0’
//            chares[top]=(char)((shor%2));
            System.out.println(shor%2);
//            System.out.println((char)((shor%2)+'0'));
            if (shor%2==0){
                chares[top]='0';
            }else {
                int i=2;
                shor=(short)(shor/i);
            }
        }   for (char s:chares){
            System.out.print(s);

        }
    }
}
